<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>注册</title>
    <link rel="icon" type="image/png" href="<?php echo base_url() .'public/assets/i/favicon.png'; ?>">
    <link rel="apple-touch-icon-precomposed" href="<?php echo base_url() .'public/assets/i/app-icon72x72@2x.png'; ?>">
    <link rel="stylesheet" href="<?php echo base_url() .'public/assets/css/amazeui.min.css'; ?>" />
    <link rel="stylesheet" href="<?php echo base_url() .'public/assets/css/amazeui.datatables.min.css'; ?>" />
    <link rel="stylesheet" href="<?php echo base_url() .'public/assets/css/app.css'; ?>">
    <script src="<?php echo base_url() . 'public/'; ?>assets/js/jquery.min.js"></script>
    <script src="<?php echo base_url() . 'public/'; ?>assets/layer/layer.js"></script>
</head>
<body data-type="login">
<script src="<?php echo base_url() .'public/assets/js/theme.js'; ?>"></script>
<div class="am-g tpl-g">
    <div class="tpl-login">
        <div class="tpl-login-content">
            <div class="tpl-login-title">注册用户</div>
            <form class="am-form tpl-form-line-form" method="post">
                <div class="am-form-group">
                    <input type="text" class="tpl-form-input username" name="username" placeholder="用户名">
                </div>
                <div class="am-form-group">
                    <input type="password" class="tpl-form-input password" name="password" placeholder="请输入密码">
                </div>
                <div class="am-form-group">
                    <input type="email" class="tpl-form-input email" name="email" placeholder="邮箱">
                </div>
                <button><a href="<?php echo site_url() . '/Welcome/register'; ?>">登录</a></button>
                <div class="am-form-group">
                    <br><button type="button" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/amazeui.min.js"></script>
<script src="<?php echo base_url() . 'public/'; ?>assets/js/app.js"></script>
<script>
$('.am-btn').click(
    function() {
        var data = {};
        data.username = $('.username').val();
        data.password = $('.password').val();
        data.email = $('.email').val();
        console.log(data);
        var url = "<?php echo site_url(); ?>/Welcome/enroll";
        $.post(url,data,function(json) {
                layer.msg('注册成功');
                location.href = "<?php echo site_url(); ?>/Welcome/index";
        },'json');
    }
);
</script>
</body>
</html>